import java.awt.Image;

import javax.swing.ImageIcon;

public class Bullet {

    private int x, y;
    private Image image;
    private boolean visible;
    private final int boardHeight = 750;
    private final int bulletSpeed = 2;

    //Creates a new bullet object will have a starter position next to the character
    public Bullet(int x, int y) {
        ImageIcon ii = new ImageIcon("bullet.png", "bullet");
        image = ii.getImage();
        visible = true;
        this.x = x;
        this.y = y;
    }
    
    //Basic getter methods
    public Image getImage() {
        return image;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public boolean isVisible() {
        return visible;
    }

    //Moves the bullet downwards except if the bullet is no longer on the board
    public void move() {
        y += bulletSpeed;
        if (y > boardHeight)
            visible = false;
    }
}